10/01/2002
5:45 PM

 

PreviousNext
 
   
Frankentosh: Building Robots using Mac OS X
 
   
  • Robocode -- Building a robot
    • So, again, let's start by building a simple robot
    • Robot's the base class for all Robocode robots, so you'll extend Robot class like this:
    • 		
      public class BeginnerRobot extends Robot {
      	public run() {
      		while (true)  {
      			ahead(100);
      			turnLeft(180);
      		)
      	}
      }
      
    • It's pretty simple to start with
    • This moves the robot ahead 100, turns it around, and repeats
    • Note that the scanner is always on, so it scans wherever the robot is
 
   
Ted Stevko, Stevko Studios http://www.plasticnoodle.com